home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / patch / patch.zoo / assert.h next >
Encoding:
C/C++ Source or Header  |  1988-11-17  |  676 b   |  30 lines

  1. /* Allow this file to be included multiple times
  2.    with different settings of NDEBUG.  */
  3. #undef assert
  4. #undef __assert
  5.  
  6. #ifdef NDEBUG
  7. #define assert(ignore)
  8. #else
  9.  
  10. #define assert(expression)  \
  11.   ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__))
  12.  
  13.  
  14. #ifdef __STDC__
  15.  
  16. #define __assert(expression, file, line)  \
  17.   (fprintf (stderr, "Failed assertion " expression        \
  18.           " at line %d of `" file "'.\n", line),    \
  19.    abort ())
  20.  
  21. #else /* no __STDC__; i.e. -traditional.  */
  22.  
  23. #define __assert(expression, file, line)  \
  24.   (fprintf (stderr, "Failed assertion at line %d of `%s'.\n", line, file),    \
  25.    abort ())
  26.  
  27. #endif /* no __STDC__; i.e. -traditional.  */
  28.  
  29. #endif
  30.